//查询数据
const MongoClient = require('mongodb').MongoClient;
const url = 'mongodb://localhost:27017';
const dbName = 'runoob';
MongoClient.connect(url, {
    useNewUrlParser: true
}, (err, client) => {
    if (err) throw err;
    const db = client.db(dbName);
    // 基本查询示例：
    db.collection('bookinfo').find({

    }).toArray((err, docs) => {
        if (err) throw err;
        console.log('找到下列记录：');
        console.log(docs);
        client.close;
    })

})